{% extends "base.phtml" %}


{% block content %}

<div class="box">
    <div class="box-header with-border">
        <h3 class="box-title">
            <a href="/acp/manager/adduser" class="btn btn-primary btn-sm">新增用户</a>
        </h3>
        <div class="box-tools">
            <form method="get">
                <div class="input-group input-group-sm" style="width: 150px;">
                    <input type="text" name="name" class="form-control pull-right" placeholder="用户查找">
                    <div class="input-group-btn">
                        <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="box-body">
        <table class="table table-bordered  table-hover">
            <tr>
                <th>UID</th>
                <th>用户名</th>
                <th>电话</th>
                <th>用户组</th>
                <th>业务部门</th>
                <th style="width: 250px">操作</th>
            </tr>
            {%for k,v in list%}
            <tr>
                <td>{{v.id}}</td>
                <td>{{v.username}}</td>
                <td>{{v.phone}}</td>
                <td>{{groupnames[v.groupid] is defined ?groupnames[v.groupid]:''}}</td>
                <td>{{bustype[v.busid] is defined ?bustype[v.busid]:''}}</td>
                <td>
                    <a href="edituser?id={{v.id}}" class="btn btn-primary">修改</a>
                    <a data-url="switch?id={{v.id}}&enable={{v.enable?0:1}}" class="btn btn-info switch">{%if v.enable%}关闭{%else%}开启{%endif%}</a>
                    <a data-url="deleteuser?id={{v.id}}" class="btn btn-danger pull-right delete">删除</a>
                </td>
            </tr>
            {%endfor%}
        </table>
    </div>

    <div class="box-footer clearfix">
       {{pageHtml}}
    </div>
</div>

{% endblock %}